﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bowling.Test
{
    // score sheet knows two things ... frames and frame formatters
    public class ScoreSheet
    {
        private readonly List<Frame> _frames;

        public ScoreSheet(List<Frame> frames)
        {
            _frames = frames;
        }

        public override string ToString()
        {
            var sb = new StringBuilder();
            _frames.ForEach(frame =>
                                {
                                    var lineFormatter = new ScoreLineFormatter(frame);
                                    sb.AppendLine(lineFormatter.GetScoreSheetLine());
                                });
            return sb.ToString();
        }

        
    }
}
